<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title></title>
</head>
<body>

<script type="text/javascript" src="./ajax.js"></script>
<script type="text/javascript">
	


	// ajax('get', "https://geoapi.qweather.com/v2/city/lookup",{
	// 	location:"青岛",
	// 	key:"c494e264764449f7b4f6bf742276d7f9"},false,function(res) {
	// 		console.log(res)
	// 	})
	ajax({
		method:'post',
		url:'http://wish.byesame.com/login',
		params:{
			userName:'admin',
			passWord:'123456'
		},
		ContentType:'application/x-www-form-urlencoded',
		success:function(res) {
			console.log(res)
			localStorage.setItem('token',res.data.token)
			list()
		}
	})


	function list() {
		ajax({
			method:'get',
			url:'http://wish.byesame.com/admin',
			params:{
				page:1,
				rows:10
			},
			token:localStorage.getItem('token'),
			success:function(res) {
				console.log(res)
				search()
			}
		})
	}
	function search() {
		ajax({
			//http://wish.byesame.com/admin/44445
			method:'getOther',
			url:'http://wish.byesame.com/admin',
			params:{
				id:44445
			},
			token:localStorage.getItem('token'),
			success:function(res) {
				console.log(res)
			}

		})
	}
</script>
</body>
</html>